-
Notifications
You must be signed in to change notification settings - Fork 87
Add CSP #7990
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add CSP #7990
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
|
vite.config.ts
Outdated
indexHtmlCsp( | ||
// production means it was build using `vite build` | ||
mode == 'production' | ||
? process.env.VITE_KITTYCAD_BASE_DOMAIN === 'dev.zoo.dev' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will likely be the first place logic is tied to BASE_DOMAIN
so I want to make sure @nadr0 signs off on this approach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would happen if someone changes the BASE_DOMAIN during runtime, would these HTML headers be bricked?
Someone that builds a production binary is allowed to point the base domain to any domain. Localhost, dev, zoogov.dev and production.
If this bricks that workflow we are going to need a new approach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BASE_DOMAIN is only for vercel essentially. mode == 'produciton' is my way to detect if we build on vercel right now.
So probably changing that would be required.
The CSP does not allow connecting to gov or localhost right now, so either we adapt the CSP or include them in a certain configuration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed the vercel detection and also only enabled CSP for "production" builds in web
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am blocking to prevent zoogov.dev from being bricked.
Deployment failed with the following error:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.
Deployment failed with the following error:
Learn More: https://vercel.com/docs/concepts/projects/project-configuration |
So far this has been tested on localhost.